import { createRouter, createWebHistory } from "vue-router";

// import Layout from "./pages/Layout.vue";
const Layout = () => import("./pages/Layout.vue");
// import Login from "./pages/Login.vue";
const Login = () => import("./pages/Login.vue");

// import Dashboard from "./views/Dashboard.vue";
const Dashboard = () => import("./views/Dashboard.vue");
// import AuthManger from "./views/AuthManger.vue";
const AuthManger = () => import("./views/AuthManger.vue");
// import MenuManger from "./views/MenuManger.vue";
const MenuManger = () => import("./views/MenuManger.vue");
// import RoleManger from "./views/RoleManger.vue";
// const RoleManger = () => import("./views/RoleManger.vue");

const router = createRouter({
  history: createWebHistory(),
  // history: createWebHashHistory(),

  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        {
          path: "/dashboard",
          component: Dashboard,
        },
        {
          path: "/auth",
          component: AuthManger,
        },
        {
          path: "/menu",
          component: MenuManger,
        },
        {
          path: "/role",
          component: () => import("./views/RoleManger.vue"),
        },
      ],
    },
    {
      path: "/login",
      component: Login,
    },
  ],
});

export default router;
